#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <windows.h>

//Test aenderung

struct monster
{
    char name[12];
    int hitPoints;
    float dexterity;
    float armour;
    int hpRegenerationPerRound;
    //feel free to expand upon (monster pictures, special abilitys, experience)
};

void resetMonster( struct monster* M)
{
//got start over


}

void fight(struct monster * MA,struct  monster* MB)
{

//Here it is determinated what is skill, and what is rand()

}


//This project generates random Monsters to fight each other
int main()
{
    struct monster monsterArray [42];
    int LastMonsterStanding=0;
    int i=0;
    srand((unsigned)time(NULL));

    //initalisation
    for (i=0;i< 42;i++)
    {
     monsterArray[i].hitPoints= 10+ rand()%100;
     monsterArray[i].dexterity= (float) 5+ rand()%10;
     monsterArray[i].armour=(float)(rand()%3);
     monsterArray[i].hpRegenerationPerRound=(rand()%25);
    }

    //tourney
    for (i=1;i< 42;i++)
    {
        //reset the last Monster Standing
        resetMonster(&(monsterArray[LastMonsterStanding]));

     while ( monsterArray[i].hitPoints > 0 || monsterArray[LastMonsterStanding].hitPoints > 0)
            {
                //fight
              fight(&monsterArray[i],&monsterArray[LastMonsterStanding]);
              Sleep(30);
            }

            //Dertimante the winner
            if (!monsterArray[i].hitPoints)
            {
                LastMonsterStanding=i;
                printf( "And the winner is Monster %s",monsterArray[LastMonsterStanding].name);
            }

    }



    return 0;
}
